﻿using Manox.Libs.Networking;
using System;

namespace Manox.Libs.Networking
{
    /// <summary>
    /// Unity network message.
    /// </summary>
    public class SendIdentifyMessage : NetworkMessage
    {
        /// <summary>Id.</summary>
        public Guid Id;


        /// <summary>
        /// Constructor.
        /// </summary>
        public SendIdentifyMessage()
        {

        }

        /// <summary>
        /// Serialize method.
        /// </summary>
        /// <param name="writer"></param>
        public override void Serialize(SerializeWriter writer)
        {
            base.Serialize(writer);

            writer.Write(this.Id);
        }

        /// <summary>
        /// Deserialize method.
        /// </summary>
        /// <param name="reader"></param>
        public override void Deserialize(SerializeReader reader)
        {
            base.Deserialize(reader);

            this.Id = reader.ReadGuid();
        }
    }
}
